---
layout: post
title: Theano (python library)
date: '2014-11-01T14:28:00.001-07:00'
author: Alex Rogozhnikov
tags:
- Theano
- Python
- Neural Networks
modified_time: '2014-11-23T12:59:14.267-08:00'
blogger_id: tag:blogger.com,1999:blog-307916792578626510.post-149419364896552305
blogger_orig_url: http://brilliantlywrong.blogspot.com/2014/11/theano-python-library.html
---

<div dir="ltr" style="text-align: left;" trbidi="on">If you want to experiment with neural networks, &nbsp;and you know python, then my best recommendation is: use theano.<br /><br />Theano is not about neural networks, really - it is ... hm ... mathematical engine. Something between Matlab and Mathematica.<br />It is close to Matlab because uses vectorization (the final function will operate vectors).<br /><br />It is close to Mathematica, &nbsp;because first you define some expression (function as analytical expression). You can compute (analytical) derivatives, and this is crucial for neural networks, because the main thing you need is derivatives, and nobody wants to spend his time on computing derivatives, specially when some library can do this for you.<br /><br />After you defined needed function-expressions (activation function and gradient of loss function for neural network), you can compile it with theano (get really a function that can be evaluated for some arguments). The compiled function is vectorized and very fast (though compilation usually takes some time). Your functions can be evaluated on GPU as well.<br /><br />This gives an ability to define your <b>new</b> neural networks in few lines of code (just by defining activation function). Impressive?<br /><br /><a href="http://deeplearning.net/software/theano/" target="_blank">Documentation on theano</a><br /><a href="https://github.com/Theano/Theano/" target="_blank">Github</a><br /><a href="http://deeplearning.net/tutorial/" target="_blank">Examples</a>&nbsp;(mostly about neural networks, probably the easiest way to start and understand how good theano is)<br /><br />Even more examples (with less explanation) can be found <a href="https://github.com/lisa-lab/DeepLearningTutorials/tree/master/code" target="_blank">here</a>.</div>